﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using JYH.Data;
using Newtonsoft.Json;
using JYH.Model;
using JYH.DataAccess;
using JYH.Framework;

namespace JYH.Business
{
    /// <summary>
    ///  SysParaInfo
    /// </summary>
    public class SysParaInfoBLL : BusinessBase<SysParaInfo>
    {
        /// <summary>
        ///  SysParaInfo
        /// </summary>
        public SysParaInfoBLL()
        {
            myDataBase = DB.D();
            this.SqlSelect = @"; Select SysParaInfo.* From SysParaInfo";
        }

        /// <summary>
        /// 获取一个参数集合
        /// </summary>
        /// <param name="ParaNO"></param>
        /// <param name="Msg"></param>
        /// <returns></returns>
        public static SysParaInfo GetParaInfo(string ParaNO, out string Msg)
        {
            SysParaInfo info = new SysParaInfo();
            Msg = string.Empty;
            Database db = DB.D();
            try
            {
                Sql sql = new Sql();
                sql.Append(";Select SysParaInfo.* From SysParaInfo");
                sql.Where("SysParaInfo.ParaNO='" + ParaNO + "'");
                info = db.FirstOrDefault<SysParaInfo>(sql);
                if (info == null)
                {
                    Msg = "Para Is Not Ext.";
                }
                return info;
            }
            catch (Exception ex)
            {
                Msg = ex.Message;
                return null;
            }
        }
    }
}